[Unit]
Description=Alert Manager
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull {{ alertmanager_container }}
ExecStart=/usr/bin/docker run --rm --network host --name %n -v {{ alertmanager_config_dir }}:/etc/alertmanager -v {{ alertmanager_docker_volume_name }}:/alertmanager {{ alertmanager_container }}

[Install]
WantedBy=multi-user.target
